<template>
  <div>
    <el-main>
      <el-table
        :data="tableData"
        border
        style="width: 100%"
        :header-cell-style="{ background: '#58B7FF', color: '#ffffff' }"
      >
        <el-table-column fixed="left" prop="department" label="部门">
        </el-table-column>
        <el-table-column fixed="left" prop="post" label="岗位">
        </el-table-column>

        <el-table-column fixed="left" prop="rank" label="职级">
        </el-table-column>

        <el-table-column prop="num" label="数量"> </el-table-column>

        <el-table-column label="操作">
          <template slot-scope="scope">
            <el-button size="mini" @click="editformation(scope.row)"
              >编辑</el-button
            >
            <el-button
              size="mini"
              type="danger"
              @click="deleteformation(scope.$index, scope.row)"
              >删除</el-button
            >
          </template>
        </el-table-column>
      </el-table>
    </el-main>
  </div>
</template>

<script>
export default {
  props: ["tableData"],

  methods: {

    editformation(row) {
      this.$emit("editformation", row);
    },

    deleteformation(index, row) {
      this.$emit("deleteformation", index, row);
    },
  },
};
</script>

<style lang="scss" scoped>
</style>